<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
	    <include file='__VIEW__/Common/header' />
	</head>
	<body>
		<form action="{|U:'add'}" method="post">
		<table class="table table-hover">
			<tr class="active">
				<th width="90">ID</th>
				<foreach from="$attrsData" key="$adk" value="$adv">
					<th>{$adv.taname}</th>
				</foreach>
				<th>库存</th>
				<th>货号</th>
				<th width="260">操作</th>
			</tr>
			<if value="empty($glArr)">
				<!-- <tr><td colspan="3">还没有货品</td></tr> -->
			<else />
				<foreach from="$glArr" key="$k" value="$v">
					<tr>
						<td>{$v.glid}</td>
						<foreach from="$v['combine']" key="$cok" value="$cov">
							<td>{$cov.gavalue}</td>
						</foreach>
						<td>{$v.glinventory}</td>
						<td>{$v.glnumber}</td>
						<td>
							<a href="{|U:'edit',array('glid'=>$v['glid'],'gid'=>$v['vshop_goods_gid'])}" class="btn btn-sm btn-warning">编辑</a>
							<a href="javascript:;" class="btn btn-sm btn-danger" onclick="del('{|U:'del',array('glid'=>$v['glid'])}')">删除</a>
						</td>
					</tr>
				</foreach>
			</if>
			<tr>
				<td style="line-height: 42px;">添加货品</td>
				<foreach from="$attrsData" key="$k" value="$v">
					<td><select name="combine[]" class="form-control"><option value="">请选择</option>
						<foreach from="$goodsAttrs" key="$gak" value="$gav">
							<if value="$v['taid']==$gav['vshop_typeattr_taid']">
								<option value="{$gav.gaid}">{$gav.gavalue}</option>
							</if>
						</foreach>
					</select></td>
				</foreach>
				<td><input type="text" name="glinventory" value="0" class="form-control" /></td>
				<td><input type="text" name="glnumber" value="" class="form-control" /></td>
			</tr>
		</table>
		<input type="hidden" name="gid" value="{$hd.get.gid}" />
		<input type="submit" class="btn btn-sm btn-success" value="添加货品" />
		</form>
		<div id="page">{$pageData}</div>
	</body>
</html>
